/*
        Author: Nathan Newman
        File Name: pcbCommands.h
        Description: Header file for pcbCommands.c
        Last updated: 9/21/11

*/

#include "pcbCode.h"

//Error codes
#define ERR_PCB_NOTFOUND -700
#define ERR_BAD_PRIORITY -701

//interface with command handler, parse command line arguments, etc.
int getPcbCommand(char args[MAX_NARGS][MAX_ARGLEN], int nArgs);

//helper methods
void printSyntaxError(void);
int getPriority(char*,int*);
int print_pcb(pcb*,int);
int showQ(enum pcbState);

//Note: for the following error-returning commands, 0 indicates success, and 
//a negative error code indicates failure

//permanent (?) commands
int suspend_pcb(char*); //suspend process or generate error
int resume_pcb(char*); //de-suspend process or generate error
int set_pcb_priority(char*,int); //update process's priority to value or generate error
int show_pcb(char*,int); //display the process or generate error
int show_all_pcbs(void); //display all system processes or generate error
int show_ready_pcbs(void); //display all ready processes or generate error
int show_blocked_pcbs(void); //display all blocked processes or generate error

//TEMPORARY commands
int create_pcb(char*,int,enum pcbClass); //allocate and setup, or display error
int delete_pcb(char*); //delete and free pcb, or display error
int block_pcb(char*); //update the pcb's state to BLOCKED
int unblock_pcb(char*); //update the pcb's state to READY




